package com.yan.scanner.demo;

import java.util.Scanner;

public class ScannerDemo2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        // 输入年龄
        System.out.println("输入年龄");
        int age = input.nextInt();
        System.out.println("age = " + age);
        // 吃掉\n
        input.nextLine();
        // 输入名字
        System.out.println("输入名字");
        String name = input.nextLine();
        System.out.println("name = " + name);
        // 输入成绩
        System.out.println("输入成绩");
        double grade = input.nextDouble();
        System.out.println("grade = " + grade);

    }
}
